home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / LIBRARY / RTPC10 / BLANK.PAS < prev    next >
Pascal/Delphi Source File  |  1993-11-22  |  4KB  |  86 lines

  1. {
  2.   ┌────────┬──────────────────────────────────────────────────────┐
  3.   │Name    │ BLANK.PAS                                            │
  4.   ├────────┼──────────────────────────────────────────────────────┤
  5.   │Use     │ Just an example program for TP6 and above.           │
  6.   │        │ A TSR that blanks the screen after inactivity        │
  7.   ├────────┼──────────────────────────────────────────────────────┤
  8.   │By      │ Rafe Aldridge - (C) Copyright 1993                   │
  9.   └────────┴──────────────────────────────────────────────────────┘
  10.   ┌───────────────────────────────────────────────────────────────┐
  11.   │ Please realise that this program present's an idea. No claim  │
  12.   │ is made that it is well written or cannot be improved upon    │
  13.   └───────────────────────────────────────────────────────────────┘
  14.   ┌───────────────────────────────────────────────────────────────┐
  15.   │ Rafe's TP Collection is SHAREWARE                             │
  16.   ├───────────────────────────────────────────────────────────────┤
  17.   │                                                               │
  18.   │ If you find any part of Rafe's TP Collection usefull then     │
  19.   │ please become a registered user by sending 10 Pounds Sterling │
  20.   │ to the address below. In return you will recieve the LATEST   │
  21.   │ FULL source code to ALL the units as well anything new.       │
  22.   │                                                               │
  23.   │ Please feel free to write with suggestions, ideas or money to │
  24.   │     Rafe Aldridge,                                            │
  25.   │     Street Farm,                                              │
  26.   │     Dereham Road,                                             │
  27.   │     Garvestone,                                               │
  28.   │     Norfolk.                                                  │
  29.   │     NR9 4QT                                                   │
  30.   │     ENGLAND                                                   │
  31.   │                                                               │
  32.   └───────────────────────────────────────────────────────────────┘
  33. }
  34.  
  35. { ---------------------------------------------------------------------- }
  36. { NOTES:                                                                 }
  37. { o A TP interrupt proc disables interrupts. Hence the need for an STI.  }
  38. { o An interrupt proc must not last more than 50mS. If it will last      }
  39. {   longer then a busy flag must be used to stop recursion.              }
  40. { ---------------------------------------------------------------------- }
  41.  
  42. {$M 1524,0,0} { preserve some memory for the TSR }
  43.  
  44. {$R-,S-,D-,L-,F-}
  45.  
  46. uses dos,vga;
  47.  
  48. var cnt : word; { count reached }
  49.     keyb_vec : pointer;
  50.     tim_vec : pointer;
  51.  
  52. procedure keyboard; interrupt; { replacement keyboard handler }
  53. begin
  54.   asm { call the old int handler }
  55.     pushf
  56.     call dword ptr keyb_vec
  57.   end;
  58.   if cnt>2000 then VGAOn; { if the screen was off turn it on }
  59.   cnt:=0; { reset count }
  60.   asm
  61.     STI { enable interrupts }
  62.   end;
  63. end;
  64.  
  65. procedure clock; interrupt;
  66. begin
  67.   asm { call the old int handler }
  68.     pushf
  69.     call dword ptr tim_vec
  70.   end;
  71.   if cnt>2000 then VGAOff; { if the count has been reached switch of screen }
  72.   inc (cnt,1); { increment the counter }
  73.   asm
  74.     STI { enable interrupts }
  75.   end;
  76. end;
  77.  
  78. begin
  79.   getintvec (9,keyb_vec);
  80.   getintvec (8,tim_vec);
  81.   setintvec (9,@keyboard);
  82.   setintvec (8,@clock);
  83.   cnt:=0;
  84.   keep(0);
  85. end.
  86.